package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:05:03
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SysUserLoginLogBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysUserLoginLogDAO.Id);

        mappedDaoFields.put("userId",
            com.ourteam.system.dao.ISysUserLoginLogDAO.UserId);

        mappedDaoFields.put("sessionId",
            com.ourteam.system.dao.ISysUserLoginLogDAO.SessionId);

        mappedDaoFields.put("loginTime",
            com.ourteam.system.dao.ISysUserLoginLogDAO.LoginTime);

        mappedDaoFields.put("loginIp",
            com.ourteam.system.dao.ISysUserLoginLogDAO.LoginIp);

        mappedDaoFields.put("logoutTime",
            com.ourteam.system.dao.ISysUserLoginLogDAO.LogoutTime);

        mappedDaoFields.put("onlineTime",
            com.ourteam.system.dao.ISysUserLoginLogDAO.OnlineTime);

        mappedDaoFields.put("userName",
            com.ourteam.system.dao.ISysUserLoginLogDAO.UserName);

        mappedDaoFields.put("userType",
            com.ourteam.system.dao.ISysUserLoginLogDAO.UserType);

        mappedDaoFields.put("userAccount",
            com.ourteam.system.dao.ISysUserLoginLogDAO.UserAccount);

        mappedDaoFields.put("userStatus",
            com.ourteam.system.dao.ISysUserLoginLogDAO.UserStatus);

        mappedDaoFields.put("onlineMinute",
            com.ourteam.system.dao.ISysUserLoginLogDAO.OnlineMinute);

        mappedDaoFields.put("lastAccessedTime",
            com.ourteam.system.dao.ISysUserLoginLogDAO.LastAccessedTime);

        mappedDaoFields.put("loginStatus",
            com.ourteam.system.dao.ISysUserLoginLogDAO.LoginStatus);
    }

    private com.ourteam.system.dao.SysUserLoginLog sysUserLoginLog;

    public SysUserLoginLogBean() {
        super();

        this.sysUserLoginLog = new com.ourteam.system.dao.SysUserLoginLog();
    }

    public SysUserLoginLogBean(
        com.ourteam.system.dao.SysUserLoginLog sysUserLoginLog) {
        super();

        this.sysUserLoginLog = sysUserLoginLog;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysUserLoginLog);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysUserLoginLog convertToSysUserLoginLog() {
        return this.sysUserLoginLog;
    }

    public com.ourteam.system.dao.SysUserLoginLog convertTo() {
        return this.sysUserLoginLog;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysUserLoginLog.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysUserLoginLog.setId(id);
    }

    /**
     * Get userId
     *
     * @return long
     */
    public long getUserId() {
        return (long) this.sysUserLoginLog.getUserId();
    }

    /**
     * Set userId
     *
     * @parameter long
     */
    public void setUserId(long userId) {
        this.sysUserLoginLog.setUserId(userId);
    }

    /**
     * Get sessionId
     *
     * @return String
     */
    public String getSessionId() {
        return (String) this.sysUserLoginLog.getSessionId();
    }

    /**
     * Set sessionId
     *
     * @parameter String
     */
    public void setSessionId(String sessionId) {
        this.sysUserLoginLog.setSessionId(sessionId);
    }

    /**
     * Get loginTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLoginTime() {
        return (java.util.Date) this.sysUserLoginLog.getLoginTime();
    }

    /**
     * Set loginTime
     *
     * @parameter java.util.Date
     */
    public void setLoginTime(java.util.Date loginTime) {
        this.sysUserLoginLog.setLoginTime(loginTime);
    }

    /**
     * Get loginIp
     *
     * @return String
     */
    public String getLoginIp() {
        return (String) this.sysUserLoginLog.getLoginIp();
    }

    /**
     * Set loginIp
     *
     * @parameter String
     */
    public void setLoginIp(String loginIp) {
        this.sysUserLoginLog.setLoginIp(loginIp);
    }

    /**
     * Get logoutTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLogoutTime() {
        return (java.util.Date) this.sysUserLoginLog.getLogoutTime();
    }

    /**
     * Set logoutTime
     *
     * @parameter java.util.Date
     */
    public void setLogoutTime(java.util.Date logoutTime) {
        this.sysUserLoginLog.setLogoutTime(logoutTime);
    }

    /**
     * Get onlineTime
     *
     * @return long
     */
    public long getOnlineTime() {
        return (long) this.sysUserLoginLog.getOnlineTime();
    }

    /**
     * Set onlineTime
     *
     * @parameter long
     */
    public void setOnlineTime(long onlineTime) {
        this.sysUserLoginLog.setOnlineTime(onlineTime);
    }

    /**
     * Get userName
     *
     * @return String
     */
    public String getUserName() {
        return (String) this.sysUserLoginLog.getUserName();
    }

    /**
     * Get userType
     *
     * @return String
     */
    public String getUserType() {
        return (String) this.sysUserLoginLog.getUserType();
    }

    /**
     * Get userAccount
     *
     * @return String
     */
    public String getUserAccount() {
        return (String) this.sysUserLoginLog.getUserAccount();
    }

    /**
     * Get userStatus
     *
     * @return String
     */
    public String getUserStatus() {
        return (String) this.sysUserLoginLog.getUserStatus();
    }

    /**
     * Get onlineMinute
     *
     * @return float
     */
    public float getOnlineMinute() {
        return (float) this.sysUserLoginLog.getOnlineMinute();
    }

    /**
     * Set onlineMinute
     *
     * @parameter float
     */
    public void setOnlineMinute(float onlineMinute) {
        this.sysUserLoginLog.setOnlineMinute(onlineMinute);
    }

    /**
     * Get lastAccessedTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLastAccessedTime() {
        return (java.util.Date) this.sysUserLoginLog.getLastAccessedTime();
    }

    /**
     * Set lastAccessedTime
     *
     * @parameter java.util.Date
     */
    public void setLastAccessedTime(java.util.Date lastAccessedTime) {
        this.sysUserLoginLog.setLastAccessedTime(lastAccessedTime);
    }

    /**
     * Get loginStatus
     *
     * @return String
     */
    public String getLoginStatus() {
        return (String) this.sysUserLoginLog.getLoginStatus();
    }

    /**
     * Set loginStatus
     *
     * @parameter String
     */
    public void setLoginStatus(String loginStatus) {
        this.sysUserLoginLog.setLoginStatus(loginStatus);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SysUserLoginLogBean) == false) {
            return false;
        } // end if

        SysUserLoginLogBean other = (SysUserLoginLogBean) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysUserLoginLog tempSysUserLoginLog = other.convertToSysUserLoginLog();

        if ((tempSysUserLoginLog == null) || (this.sysUserLoginLog == null)) {
            isEqual = false;
        } else if ((tempSysUserLoginLog == this.sysUserLoginLog) ||
                tempSysUserLoginLog.equals(this.sysUserLoginLog)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SysUserLoginLogBean[] toArray(
        com.ourteam.system.dao.SysUserLoginLog[] aSysUserLoginLogs) {
        return toArray(aSysUserLoginLogs, null);
    }

    public static SysUserLoginLogBean[] toArray(
        com.ourteam.system.dao.SysUserLoginLog[] aSysUserLoginLogs,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysUserLoginLogs)) {
            return new SysUserLoginLogBean[0];
        }

        int length = aSysUserLoginLogs.length;

        SysUserLoginLogBean[] beans = new SysUserLoginLogBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SysUserLoginLogBean(aSysUserLoginLogs[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysUserLoginLogs[i] });
            }
        }

        return beans;
    }
}
